﻿<phone:PhoneApplicationPage xmlns:my="clr-namespace:Pomodoro"  
    x:Class="Pomodoro.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <ImageBrush ImageSource="Images\Background.png" Stretch="Fill"/>
        </Grid.Background>


        <StackPanel x:Name="PomodoroBackground" Style="{StaticResource PomodoroBackground}">
            
            <!-- Wheel -->
            <my:Wheel x:Name="Wheel" Height="180" />
            <Image Source="Images\WheelGutter.png" Stretch="Fill" Height="8" Margin="0 10 0 10"/>
            <Image Source="Images\WheelMarker.png" Stretch="None" Height="15" Width="250" HorizontalAlignment="Left" />
            <Image Source="Images\SelfTimerIcon.png" Stretch="None" Height="64" Width="66" HorizontalAlignment="Center" Margin="0,190,0,0" x:Name="SelfTimerIcon" Visibility="{Binding SelfTimerIconVisibility, Mode=TwoWay}" />

            <!-- Settings -->
            <controls:Pivot x:Name="Settings" Visibility="{Binding SettingsVisibility, Mode=TwoWay}">
                <controls:PivotItem Header="options">

                    <StackPanel Margin="40,0,0,0">
                        <TextBlock Text="Settings:" Margin="-20,0,0,0"></TextBlock>

                        <CheckBox
                            Content="Run when screen locked"
                            IsChecked="{Binding LockedScreenEnabled, Mode=TwoWay}"
                            />

                        <CheckBox
                            Content="Mute sound"
                            IsChecked="{Binding Mute, Mode=TwoWay}"
                            />

                        <CheckBox
                            Content="Vibrate when timer ends"
                            IsChecked="{Binding Vibrate, Mode=TwoWay}"
                            />
                    </StackPanel>

                </controls:PivotItem>

                <controls:PivotItem Header="about">
                    <Grid>
                        <Image Source="Images\Egg.png" Stretch="None" Height="267" Width="209" Margin="0,90,-30,0" HorizontalAlignment="Right" />
                        <StackPanel>
                            <TextBlock Text="The Pomodoro Technique:" Margin="20,0,0,0"/>
                            <HyperlinkButton Margin="20,0,0,0" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="Blue" HorizontalAlignment="Left" VerticalAlignment="Top" NavigateUri="http://www.pomodorotechnique.com" TargetName="_blank">http://www.pomodorotechnique.com</HyperlinkButton>

                            <TextBlock Text="Source code:" Margin="20,20,0,0"/>
                            <HyperlinkButton Margin="20,0,0,0" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="Blue" HorizontalAlignment="Left" VerticalAlignment="Top" NavigateUri="http://pomodoro.codeplex.com" TargetName="_blank">http://pomodoro.codeplex.com</HyperlinkButton>

                            <TextBlock Text="Patrick de Kleijn" Margin="20,50,0,0"/>
                            <StackPanel Orientation="Horizontal" Margin="20,0,0,0">
                                <HyperlinkButton Margin="0,0,0,0" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="Blue" HorizontalAlignment="Left" VerticalAlignment="Top" NavigateUri="http://www.patrick.nl" TargetName="_blank">http://www.patrick.nl</HyperlinkButton>
                                <TextBlock Margin="0,0,0,0" Text=" 2011"/>
                            </StackPanel>

                        </StackPanel>
                    </Grid>
                </controls:PivotItem>

            </controls:Pivot>
        </StackPanel>


    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.sync.rest.png" Text="Wind-up" Click="WindUpWheel" />
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.feature.settings.rest.png" Text="Settings" Click="ShowSettings"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>